Ext.define('Mis.controller.MenuSolutionController', {
			extend : 'Ext.app.Controller',
//			GridDoActionUtil : Ext.create("util.GridDoActionUtil"),
			commonUtil : Ext.create("util.commonUtil"),
			init : function() {
				//this指的是当前这个MenuSolutionController
				var me = this;
				me.getGridObj = function(button) {
					return button.ownerCt.ownerCt;
				};
				me.getFormObj = function(button) {
					return button.ownerCt.ownerCt;
				};
				me.control({
					'menuSolutionGrid button[action=save]': {
		            	click : function(addbutton) {
		            		var datas = new Array();
		            		var grid = me.getGridObj(addbutton);
		            		//
				            $("input[type='checkbox']").each(function (x,y) {
				                if ($(this).is(":checked")){
				                	//此处的this指的是checkbox的input框,如<input id="0" type="checkbox" checked="checked">
				                    datas.push($(this).attr('id'));
				                }
				            });
				            console.info(datas.join(","))
				            console.info("datas.length="+datas.length);
				            if(datas.length==0){
				            	Ext.Msg.alert("提示","请至少选择一条记录");
				            }
				            //AJAX与后台交互
				            var url=grid.getStore().getProxy().api["create"];
				            var params={ids:datas.join(",")};
							console.info(url);
							console.info(params);
				            me.commonUtil.doAjax(url,params);
						}
		            },
		            'menuSolutionGrid button[action=chooseall]': {
		            	click : function(addbutton) {
							$("input[type='checkbox']").each(function () {
				                $(this).attr("checked", true);
				            });
						}
		            },
		            'menuSolutionGrid button[action=notchooseall]': {
		            	click : function(addbutton) {
						    $("input[type='checkbox']").each(function () {
				                $(this).attr("checked", false);
				            });
						}
		            }
				})
			}
		})